i <- list(line = list(color = 'black'))
d <- list(line = list(color = 'red'))
fig <- df %>%
plot_ly(x = ~Date, type = "candlestick",
open = ~GME.Open, close = ~GME.Close,
high = ~GME.High, low = ~GME.Low, name = "GME",
increasing = i, decreasing = d) %>%
add_lines(y = ~avg_30, name = "Closing 30D MvgAvg",
line = list(color = 'cadetblue')) %>%
add_lines(y = ~avg_90, name = "Closing 90D MvgAvg",
line = list(color = 'blue')) %>%
add_segments(x = buys$Date, xend = buys$Date, y = 0, yend = 500, line = list(color = "green"), name = "Buy Signal") %>%
add_segments(x = sell$Date, xend = sell$Date, y = 0, yend = 500, line = list(color = "orange"), name = "Sell Signal") %>%
layout(yaxis = list(title = "Price"))